package com.tiancheng.trade.payment.enums;

import com.tiancheng.trade.commom.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * 银联支付渠道类型
 *
 * @author likailun
 * @date 2021/04/16
 */
@Getter
@AllArgsConstructor
public enum UmsPayTargetSysEnum implements BaseEnum<String> {

    ALIPAY1("Alipay 1.0", "支付宝1.0协议"),
    ALIPAY2("Alipay 2.0", "支付宝2.0协议"),
    WXPay("WXPay", "微信"),
    YQB("YQB", "壹钱包"),
    QMF("QMF", "支全民付远程快捷"),
    UnionPay("UnionPay", "银联钱包"),
    BaiDu("BaiDu", "百度钱包"),
    JD("JD", "京东钱包"),
    SF("SF", "顺丰顺手付"),
    COMM("COMM", "交通银行"),
    BestPay("BestPay", "翼支付"),
    ACP("ACP", "银联全渠道立码付"),
    NetPayBills("NetPayBills", "银商网付平台账单模块"),
    NetPayGtwy("NetPayGtwy", "银商网付平台网关模块"),
    QmfWebPay("QmfWebPay", "POS通插件WEB版"),
    UAC("UAC", "银联全渠道"),
    ;

    private String code;
    private String desc;

    public static String getDesc(String code) {
        Optional<UmsPayTargetSysEnum> found = Arrays.stream(UmsPayTargetSysEnum.values()).filter(c -> c.code.equals(code)).findFirst();
        if (found.isPresent()) {
            return found.get().getDesc();
        }
        return "";
    }
}
